import {request} from "../../request/index"

Page({
  data: {
    swiperList: [],/// 轮播图数据
    cateList:[], /// 导航数组
    floorList:[] /// 楼层数据
  },
  /// 生命周期
  onLoad: function (options) {
    this.getSwiperList()
    this.getCateList()
    this.getFloorList()
  },
  getSwiperList() {
    request({
     url:'/home/swiperdata'
    }).then(res=>{
      this.setData({
        swiperList:res
      })
    })
  },
  getCateList() {
    request({
      url:'/home/catitems'
     }).then(res=>{
       this.setData({
         cateList:res
       })
     })
  },
  getFloorList() {
    request({
      url:'/home/floordata'
     }).then(res=>{
       this.setData({
         floorList:res
       })
     })
  }
})
